home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
domacnost a kancelar
/
findgraph
/
fgraph.exe
/
{app}
/
TestVC
/
RectItem.h
< prev
next >
Wrap
C/C++ Source or Header
|
2002-08-09
|
3KB
|
92 lines
// RectItem.h : interface of the CRectItem class
//
#if !defined(AFX_RECTITEM_H__51F9B1F0_CAEF_11D4_A5D3_444553540000__INCLUDED_)
#define AFX_RECTITEM_H__51F9B1F0_CAEF_11D4_A5D3_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainDoc;
class CMainView;
class CRectItem : public COleClientItem
{
DECLARE_SERIAL(CRectItem)
// Constructors
public:
CRectItem();
CRectItem(COleDocument* pContainer);
CRectItem(COleDocument* pContainer, int x, int y);
// Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE.
// IMPLEMENT_SERIALIZE requires the class have a constructor with
// zero arguments. Normally, OLE items are constructed with a
// non-NULL document pointer.
~CRectItem();
// Attributes
public:
CPoint m_ptPos; //position in document
CSize GetSize(); //current size
void SetSize(CSize size);
CSize GetBaseSize(); //base size
void SetBaseSize(CSize size);
CRect GetRect() //current rect
{ return CRect(m_ptPos, GetSize()); }
void SetRect(CRect& rect);
CMainDoc* GetDocument()
{ return (CMainDoc*)COleClientItem::GetDocument(); }
CMainView* GetActiveView()
{ return (CMainView*)COleClientItem::GetActiveView(); }
// Operations
void Dirty()
{ GetDocument()->SetModifiedFlag(); }
void Invalidate(CView* pNotThisView = NULL);
BOOL UpdateExtent();
void Move(CRect &rc);
void ResetSize();
void GetNativeClipboardData(COleDataSource *pDataSource);
LPDISPATCH GetIDispatch();
virtual void Serialize(CArchive& ar); // from CObject - public to call directly
// Overridables
protected:
virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
virtual BOOL OnChangeItemPosition(const CRect& rectPos);
virtual void OnActivate();
virtual COleDataSource* OnGetClipboardData(BOOL bIncludeLink,
LPPOINT lpOffset, LPSIZE lpSize);
virtual void OnDeactivateUI(BOOL bUndoable);
public:
virtual void OnGetItemPosition(CRect& rPosition);
// Implementation
public:
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
CSize m_sizeIcon; //current size
CSize m_sizeContent; //current size
CSize m_sizeIconExtent; //default size
CSize m_sizeContentExtent; //default size
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RECTITEM_H__51F9B1F0_CAEF_11D4_A5D3_444553540000__INCLUDED_)